//
//  ViewController.m
//  ImageApp
//
//  Created by iD Student on 7/8/13.
//  Copyright (c) 2013 jasonkurtzman. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if(CGRectContainsPoint(_imageViewA.frame, touchPoint))
    {
           _statusLabel.text = @"Image A is being touched.";
    }else if(CGRectContainsPoint(_imageViewB.frame, touchPoint))
    {
        _statusLabel.text = @"Image B is being touched";
    }else{
        _statusLabel.text = @"";
    }
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if(CGRectContainsPoint(_imageViewA.frame, touchPoint))
    {
        _statusLabel.text = @"Image A was released";
    }else if(CGRectContainsPoint(_imageViewB.frame, touchPoint))
    {
        _statusLabel.text = @"Image B was released";
    }else
    {
        _statusLabel.text = @"";
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
